home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Eagles Nest BBS 8
/
Eagles_Nest_Mac_Collection_Disc_8.TOAST
/
Developer Tools⁄Additions
/
TextPertDK#1
/
MPW C Sources & Examples.image
/
Example2
/
AppleScan.h
< prev
next >
Wrap
Text File
|
1991-10-25
|
8KB
|
255 lines
/*
This is the include file for the calls that are defined in the
APPLE SCANNER TECHNICAL REFERENCE MANUAL.
The calls defined in the manual are implemented by DEVICE MANAGER CALLS,
and are the standard calls that Apple has defined for a scanner.
*/
#define _32k 32768
#define ErrMemory -1000
#define ErrTrans -1001
#define FinScan 200
#define TOutFullScan 7200 /* Two Minutes */
#define TOutPartScan 900 /* 15 Seconds */
/* Type of Composition of the scan data returned */
#define ScLineArt 0
#define ScHalfTone 1
#define ScGrayScale 2
/* Gray curve used in gray scan */
#define ScLightDetail 0
#define ScNormalDetail 1
#define ScDarkDetail 2
/* Errors returned by the calls */
#define noErr 0
#define ScNotFountErr -17064 /* No scanner found */
#define ScComErr -17065 /* Communication malfunction */
#define ScResetErr -17066 /* Scanner has been reseted/Initialized; send parameters again */
#define ScParamErr -17067 /* Illegal parameter(s) or command(s) */
#define ScScannerErr -17068 /* Internal scanner hardware error */
#define ScResetErr2 -17069 /* Scanner reset; all parameters will have to be set again */
#define ScEOS -17070 /* End Of Scan */
#define TFalse 0 /* Constant Equivalent a FALSE */
#define TTrue (!TFalse) /* Constant Equivalent a TRUE */
typedef struct TagScCompRec
{
long Reserved;
short ResElements;
short HalfToneElements;
short BrightnessMax;
short ContrastMax;
long BitsPerPixel;
short MinReadSize;
}ScCompRec;
typedef struct TagScStdFeaturesRec
{
long Reserved;
short Version;
short ScanWidthNum;
short ScanWidthDen;
short ScanLengthNum;
short ScanLengthDen;
ScCompRec Composition[ScGrayScale];
}ScStdFeaturesRec, *ScStdFeaturesPtr;
typedef short ScResArray[1];
typedef short *ScResPtr;
typedef struct TagScAreaRec
{
long Reserved;
short XDpi;
short YDpi;
Rect ScanRect;
short Brightness;
short Contrast;
unsigned char Composition;
unsigned char BitsPerPixel;
short HalfTone;
}ScAreaRec, *ScAreaPtr;
typedef struct TagScScanArea
{
long Reserved;
short NumAreas;
ScAreaRec ScanAreas[1];
}ScScanArea, *ScScanAreaPtr;
typedef struct TagScAdvFeaturesRec
{
long Reserved;
short Version;
short SecondaryMax;
long DownLoadFlags;
long RestrictFlags;
long ControlFlags;
}ScAdvFeaturesRec, *ScAdvFeaturesPtr;
typedef struct TagScPatRec
{
unsigned char XDimension;
unsigned char YDimension;
unsigned char PatData[1];
}ScPatRec, *ScPatPtr;
typedef unsigned char String31[32];
typedef String31 ScHalfToneArray[1];
typedef unsigned char *ScHalfTonePtr;
/***************************************************************************************/
/********************************** ROUTINE HEADERS ************************************/
/***************************************************************************************/
/* Opening and Closing the standard driver */
/***************************************************************************************/
pascal OSErr ScOpen(Str255 Nombre, short *RefNum); /* Variation ; Also receives the name */
/* Opens the driver and reset the scanner to it default values. */
/***************************************************************************************/
pascal OSErr ScClose(short RefNum);
/* Closes the driver and releases the scanner. */
/* Getting Standard Features */
/***************************************************************************************/
/*pascal OSErr ScGetStdFeatures(short RefNum,
ScStdFeaturesPtr stdFeaturesPtr,
short Length);*/
/* Gives the user a complete description of the features of the scanner, following the
structure described in the stdFeaturesRec returned. */
/***************************************************************************************/
pascal OSErr ScGetRes(short RefNum,
short CompType,
ScResPtr ResPtr);
/* Returns an array with the resolutions supported by the scanner.
The number of Resolutions supported by the scanner is defined in the stdFeaturesRec. */
/***************************************************************************************/
pascal OSErr ScGetHalfTones(short RefNum,
short CompType,
ScHalfTonePtr HalfTonePtr);
/* Returns the list of supported halftone patterns.
This list has the structure described in the schalftone array. */
/* Setting Scan Area */
/***************************************************************************************/
pascal OSErr ScSetScanArea(short RefNum,
ScScanArea *ScanAreaPtr);
/* Sets the area to scan, and also the parameters to use in the scan of that area. */
/* Reading Scanned Data */
/***************************************************************************************/
pascal OSErr ScDoScan(short RefNum,
Ptr Buffer,
long *Count,
short Unused,
short ByteWidth,
short RowBytes);
/* Starts scan and returns data following the parameters previously set. */
/***************************************************************************************/
pascal OSErr ScAbortScan(short RefNum);
/* Aborts the scan in progress. Is the only call that the scanner
will answer to while a scan is being done. */
/* Getting Advanced Features */
/***************************************************************************************/
pascal OSErr ScGetAdvFeatures(short RefNum,
ScAdvFeaturesPtr AdvFeaturesPtr,
short Length);
/* Gives the user avdanced features of the scanner. Returns a
handle to ScAdvFeaturesRec. If a scanner doesn't support this call,
a statuserr value of -18 is returned. */
/***************************************************************************************/
pascal OSErr ScSetHtPattern(short RefNum,
ScPatPtr PatPtr);
/* Sets the downloadable halftone pattern */
/***************************************************************************************/
pascal OSErr ScSetGroup3(short RefNum,
Boolean CompressOn);
/* Enables and disables data compression in data returned by the scanner.
The compression used is Group III, 1-dimensional standard FAX encoding. */
/***************************************************************************************/
pascal OSErr ScSetNoHome(short RefNum,
Boolean NoHome);
/* This function control whether or not the carriage assembly returns
to the home position after scanning. */
/***************************************************************************************/
pascal OSErr ScSetLamp(short RefNum,
Boolean LampOn);
/* This call turns the fluorescent lamp On and Off. */
/***************************************************************************************/
pascal OSErr ScSetGrayMap(short RefNum,
short GrayMap);
/* Sets the gray map curve used while scanning. */
/***************************************************************************************/
pascal OSErr ScSetThresHold(short RefNum,
short Threshold);
/* Sets the AutoBackground threshold level. */
/***************************************************************************************/
pascal OSErr ScSetWaitButton(short RefNum,
Boolean WaitButton);
/* This function controls if the scan will begin after a
DoScan command is sent or after the scanner's scan
button has been pressed. */